<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>成长记录</title>
    <link rel="stylesheet" href="layui/css/layui.css">
</head>
<body>
 
<!-- 你的HTML代码 -->
  <div style="text-align: center;margin-top: 10px;">
      <span>☂❤多希望你无忧无虑,健健康康❤☂</span>
  </div> 
  <div style="position: absolute;margin-top: 40px;">
    <form class="layui-form" action="">
      <div class="layui-form-item">
          <label class="layui-form-label">☞尊姓大名</label>
          <div class="layui-input-block">
              <input type="text" name="user_name" required  lay-verify="required" placeholder="麻辣小龙虾" autocomplete="off" class="layui-input" value="麻辣小龙虾">
          </div>
      </div>
      <div class="layui-form-item">
          <label class="layui-form-label">☞女侠芳龄</label>
          <div class="layui-input-inline">
              <input type="text" name="user_age" required lay-verify="required" placeholder="500" autocomplete="off" class="layui-input" value="25">
          </div>
<!--           <div class="layui-form-mid layui-word-aux">不能说的秘密</div> -->
      </div>
      <div class="layui-form-item">
          <label class="layui-form-label">☞疼痛等级</label>
          <div class="layui-input-block">
              <select name="level" lay-verify="required">
                  <option value="">多希望你无忧无虑</option>
                  <option value="0"> 不疼不痒 (0)</option>
                  <option value="10">轻微结痂(10)</option>
                  <option value="20">轻微    (20)</option>
                  <option value="30">轻      (30)</option>
                  <option value="40">微痛    (40)</option>
                  <option value="60">痛      (60)</option>
                  <option value="80">很痛    (80)</option>
                  <option value="90">特别痛痒(90)</option>
                  <option value="99">严重膏肓(99)</option>
              </select>
          </div>
      </div>

      <div class="layui-form-item">
          <label class="layui-form-label">☞今日心情</label>
          <div class="layui-input-block">
              <input type="checkbox" name="mood" title="开心">
              <input type="checkbox" name="mood" title="难过">
              <input type="checkbox" name="mood" title="思念">
          </div>
      </div>
    <!--   <div class="layui-form-item">
        <label class="layui-form-label">☞开关</label>
        <div class="layui-input-block">
          <input type="checkbox" name="switch" lay-skin="switch">
        </div>
      </div> -->
<!--       <div class="layui-form-item">
          <label class="layui-form-label">性别</label>
          <div class="layui-input-block">
              <input type="radio" name="sex" value="男" title="男">
              <input type="radio" name="sex" value="女" title="女" checked>
          </div>
      </div> -->
      <div class="layui-form-item layui-form-text">
          <label class="layui-form-label">☞备注记录</label>
          <div class="layui-input-block">
              <textarea name="mark" placeholder="请输入内容" class="layui-textarea"></textarea>
          </div>
      </div>
      <div class="layui-form-item">
          <div class="layui-input-block">
              <button class="layui-btn" lay-submit lay-filter="recordSubmit">立即提交</button>
              <button type="reset" class="layui-btn layui-btn-primary">重置表单</button>
          </div>
      </div>
    </form>
 </div>
<script src="layui/layui.js"></script>
<script src="js/jquery-1.11.2.min.js"></script>
<script src="../common/common.js"></script>
</body>
<script>

	// $(document).on('touchmove',function(e){
	// 	  e.preventDefault();
	// });

  var BASE_PATH = basePath();
  var layer = layui.layer;
  //判断当前选中时间是否有记录
  if (window.parent.dataResult != "") {

  } else {

    layui.use('layer', function(){
        var layer = layui.layer;
        layer.open({
            title: '消息框',
            content: '当前时间未录入记录',
            offset: '100px'
        });  
    });        
  }

  //Demo
  layui.use('form', function(){
      var form = layui.form;

      //监听提交
      form.on('submit(recordSubmit)', function(data){
        layer.msg("愿幸运永伴你身边",function(){
            // alert(JSON.stringify(data.field));
              $.ajax({
                  url: BASE_PATH + "illnessRecord/addIllnessRecord",
                  type: 'POST',
                  dataType: 'json',
                  data: data.field
              })
              .done(function() {
                  layer.colse();
              });
        });
        return false;
      });
  });
</script>
</html>
